package object_oriented;

public class Triangle {
    public double firstEdge ;
    public double secondEdge ;
    public double thirdEdge ;


    public  double squaring(){  // 计算三角形面积
        double p = (this.firstEdge + this.secondEdge + this.thirdEdge)/2;
        double area = Math.pow( p * ( (p - this.firstEdge) * (p - this.secondEdge) * (p - this.thirdEdge)) , 0.5);
        return area ;
    }
    public boolean judgeTriangle( double firstEdge , double secondEdge , double thirdEdge){  // 判断 三条边 是否能构成三角形
        if(! ( firstEdge >= (secondEdge + thirdEdge) || secondEdge >= (firstEdge + thirdEdge) || thirdEdge >= (secondEdge + firstEdge) )){
             return true;
        }else{
             return false;
        }
    }
}
